<template>
  <div class="app-container" style="position: relative">
    <el-button
      v-if="activeName !== 'tabBar'"
      @click="handleAdd"
      type="primary"
      style="position: absolute; top: 30px; right: 50px; z-index: 6"
      >新增图标</el-button
    >
    <el-tabs v-model="activeName">
      <el-tab-pane label="首页金刚区" name="kongKimArea">
        <kongKimArea v-if="activeName === 'kongKimArea'"></kongKimArea>
      </el-tab-pane>
      <el-tab-pane label="底部导航栏" name="tabBar">
        <tabBar v-if="activeName === 'tabBar'"></tabBar>
      </el-tab-pane>
      <el-tab-pane label="我的页面" name="myPage">
        <myPage v-if="activeName === 'myPage'"></myPage>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import kongKimArea from '@/views/operate/finish/components/kongKimArea'
import tabBar from '@/views/operate/finish/components/tabBar'
import myPage from '@/views/operate/finish/components/myPage'
export default {
  name: 'FinishIndex',
  components: {
    kongKimArea,
    tabBar,
    myPage
  },
  data() {
    return {
      activeName: 'kongKimArea'
    }
  },
  methods: {
    //跳转新增页面
    handleAdd() {
      if (this.activeName === 'kongKimArea') {
        this.$router.push({
          path: '/operation/finish/add-king-kim-area',
          query: { dialogType: 'add' }
        })
      } else {
        this.$router.push({
          path: '/operation/finish/add-my-page',
          query: { dialogType: 'add' }
        })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
/deep/.el-tabs__header {
  padding: 15px;
  margin: 0px;
  // background-color: #ffffff;
}
/deep/.el-tabs__active-bar {
  width: 70px !important;
}
/deep/.el-tabs__item {
  font-size: 18px;
  font-weight: bold;
}
</style>
